<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
    <title>Document</title>
    <style>
        ul li{
            list-style: none;
        }
    </style>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(book,index) of books">{{index}}-{{book.name}}</li>
        </ul>
    </div>
    <div id="app1">
        <ul>
            <template v-for="book in books">
                <li>书名:{{book.name}}</li>
                <li>作者:{{book.author}}</li>
            </template>
        </ul>
    </div>
    <script>
        new Vue(
            {
                el: '#app',
                data: {
                    books: [
                        { name: '《Vue.js》' },
                        { name: '《Node.js》' },
                        { name: '《JavaScript》' }
                    ]
                }
            }
        )
    </script>
    <script>
        new Vue(
            {
                el: '#app1',
                data: {
                    books: [
                        { name: '《Vue.js》' ,author:'Tango'},
                        { name: '《Node.js》' ,author:'Brove'},
                        { name: '《JavaScript》',author:'Nov' }
                    ]
                }
            }
        )
    </script>
</body>

</html>